package com.imooc.controller;

import com.imooc.pojo.IMoocJSONResult;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Administrator on 2018\5\21 0021.
 */
@Controller
@RequestMapping("err")
public class ErrorController {

    @RequestMapping("error")
    public String error() {

        int a = 1/0;

        return "thymeleaf/error";
    }

    @RequestMapping("ajaxError")
    public String ajaxError() {
        return "thymeleaf/ajaxError";
    }

    @RequestMapping(value = "getAjaxError", method = RequestMethod.POST)
    @ResponseBody
    public IMoocJSONResult getAjaxError() {
        int a = 1/0;
        return IMoocJSONResult.ok();
    }
}
